<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<!--begin main-->
<div id="main">
  <div id="main_l" class="bdr_1">
    <!--位置导航-->
    <div id="position"><a href="">首页</a><?php echo catpos($r['catid']);?></div>
    <div id="content">
      <table align="center" cellpadding="0" cellspacing="1" class="down_info">
        <caption>
        <span  class="<?php echo $style;?>"><?php echo $title;?></span>
        </caption>
        <tr>
          <th>授权形式：</th>
          <td> <?php echo $copytype;?></td>
          <td width="260" rowspan="7"><img src="<?php if($r[thumb]) { ?><?php echo $r['thumb'];?><?php } else { ?>images/nopic.gif<?php } ?>" width="260"></td>
        </tr>
        <tr>
          <th>更新时间：</th>
          <td> <?php echo $updatetime;?></td>
        </tr>
        <tr>
          <th>软件语言：</th>
          <td> <?php echo $language;?></td>
        </tr>
        <tr>
          <th>软件平台：</th>
          <td> <?php echo $systems;?></td>
        </tr>
        <tr>
          <th>软件类别：</th>
          <td> <?php echo $classtype;?></td>
        </tr>
        <tr>
          <th>文件大小：</th>
          <td> <?php echo $filesize;?></td>
        </tr>
        <tr>
          <th>评论等级：</th>
          <td class="c_orange"> <?php echo $stars;?></td>
        </tr>
<tr>
          <th>下载次数：</th>
          <td colspan=2><span id="hits">0</span>（今日：<span id="todaydowns"><?php echo $todaydowns;?></span>，本周：<span id="weekdowns"><?php echo $weekdowns;?></span>，本月：<span id="monthdowns"><?php echo $monthdowns;?></span>）</td>
        </tr>
      </table>
      <h3>软件简介</h3>
      <div id="down_intro"><?php echo $content;?></div>
      <h3>下载地址</h3>
      <div id="down_address">
  <?php echo $downurl;?>
  <?php echo $downurls;?>
  </div>
      <h3>相关软件</h3>
      <div>
        <ul class="text_list">
          <?php echo tag('phpcms', 'tag_content', "SELECT DISTINCT c.contentid,c.title,c.style,c.url FROM `zzinfo_content` c,`zzinfo_content_tag` t  WHERE c.contentid=t.contentid and c.`status`=99 AND t.`tag` IN(".get_sql_in($r[keywords]).") ORDER BY c.contentid DESC", 0, 10, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '46',));?>
        </ul>
      </div>
  <?php if(isset($MODULE[mail])) { ?>
      <form action="<?php echo $MODULE['mail']['url'];?>sendmail.php" name="sendmail" id="sendmail">
        <input type="hidden" name="title" value="推荐：<?php echo $title;?>" />
        <input type="hidden" name="content" value=" <a href='<?php echo SITE_URL;?><?php echo $url;?>' target='_blank'><?php echo $title;?></a><br/>" />
      </form>
      <?php } ?>
      <?php if(isset($MODULE[error_report])) { ?>
      <form action="<?php echo $MODULE['error_report']['url'];?>error_report.php" name="errors" id="errors">
        <input type="hidden" name="title" value="<?php echo $title;?>" />
<input type="hidden" name="contentid" value="<?php echo $contentid;?>" />
      </form>
      <?php } ?>
      <p id="text_1" style="margin-top:3px;"> 
        <?php if(isset($MODULE[error_report])) { ?><a href="javascript:$('#errors').submit();">[错误报告]</a><?php } ?> 
        <?php if(isset($MODULE[mail])) { ?><a href="javascript:$('#sendmail').submit();">[推荐]</a><?php } ?> 
        <a href="javascript:myAddPanel('<?php echo $title;?>',window.location.href)">[收藏]</a> 
        <a href="javascript:window.print();">[打印]</a> 
        <a href="javascript:window.close();">[关闭]</a> <a href="<?php echo SITE_URL;?><?php echo $url;?>#top">[返回顶部]</a> 
      </p>
      <!--评论-->
      <?php if(isset($MODULE[comment])) { ?>
      <?php list($keyid, $verify) = keyid_make('phpcms', 'content', 'title', $contentid);?>
      <div id="commnent_tag">
        <a href="<?php echo $MODULE['comment']['url'];?>?keyid=<?php echo $keyid;?>&verify=<?php echo $verify;?>"><img src="images/comment.gif" alt=""/></a> 
        当前共有<strong class="c_red"><span id="comments">0</span></strong>人发表了评论.
      </div>
      <div class="commenttext" style="text-align:center;margin-top:2%">
        <form action="<?php echo $MODULE['comment']['url'];?>?action=addpost" method="post" onSubmit="return checkForm();">
<input type="hidden" name="keyid" value="<?php echo $keyid;?>"/>
<input type="hidden" name="verify" value="<?php echo $verify;?>"/>
<ul>
          <li>
            <textarea cols="100" rows="8" name="comment" id="comment" onfocus="reply_clearfield()" onblur="reply_restoration()"></textarea>
          </li>
          <li style="text-align:left;margin-left:2%;margin-top:1%;">
            <span id="checker"></span>
            <input id="dosubmit" name="dosubmit" type="submit" value="发表评论" />
          </li>
        </ul>
        </form>
      </div>
      <script type="text/javascript" src="data/js/comment_setting.js"></script>
      <script>
        $().ready(function() {
            if(setting.ischecklogin == 0 && getcookie('auth') === null)
            {
                $('#comment').val("请您登陆后发表评论！");
                $('#comment').attr("disabled","disabled");
                $('#dosubmit').attr("disabled","disabled");
            }
            else 
            {
                $('#comment').val("我也来说两句！");
            }
        });
        function reply_restoration()
        {
            if($('#comment').val() == '')
            {
                $('#comment').val("我也来说两句！");
            }
        }
        function reply_clearfield()
        {
            //$.ajax();
            if ($('#comment').val() == "我也来说两句！") 
            {
                $('#comment').val("");   
            }            
            $.ajax({
                 type: "POST",
                 url: "<?php echo $MODULE['comment']['url'];?>?action=ajaxcheckcode",
                 data:   "",
                 dataType: "html",
                 success: function(msg)
                 {
                    if(msg)
                    {
                        $('#checker').html("验证码："+msg+"&nbsp;");
                    }                    
                 } 
             });
        }
        function checkForm()
        {
            if($('#comment').val() == '' || $('#comment').val() == "我也来说两句！")
            {
                alert("内容不能为空");
                $('#comment').focus();
                return false;
            }
            if($('#checkcode').val() == '' )
            {
                alert("验证码不能为空");
                $('#checkcode').focus();
                return false;
            }
            if ($('#comment').val().length > 1000) 
            {
                alert("内容太长，最多 1000 个文字");
                return false;
            }
        }
      </script>
      <?php } ?>
      </div>
    <div class="clear" style="margin-top:1%"></div>
  </div>
  <div id="main_r">
    <h4>推荐下载</h4>
    <div>
      <ul class="pic_list">
       <?php echo tag('phpcms', 'tag_content_pic', "SELECT a.contentid,a.catid,a.typeid,a.areaid,a.title,a.style,a.thumb,a.keywords,a.description,a.userid,a.updatetime,a.inputtime,a.url FROM `zzinfo_content` a, `zzinfo_content_position` p WHERE a.contentid=p.contentid AND p.posid=5 AND a.status=99   AND  `thumb`!='' ".get_sql_catid($r[catid])." ORDER BY a.contentid DESC", 0, 6, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '14',  'height' => '62',  'width' => '87',));?>
      </ul>
    </div>
    <h4>最新下载</h4>
    <div>
      <ul class="text_list">
       <?php echo tag('phpcms', 'tag_content', "SELECT contentid,catid,typeid,areaid,title,style,thumb,keywords,description,userid,updatetime,inputtime,url,listorder FROM `zzinfo_content` WHERE  status=99  ".get_sql_catid($catid)." ORDER BY contentid DESC", 0, 10, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '46',));?>
      </ul>
    </div>
<?php echo block("list_down", 1);?>
  </div>
</div>
<!--end main-->
<script language="JavaScript" src="count.php?contentid=<?php echo $contentid;?>&model=down"></script>
<?php include template('phpcms','footer'); ?>